package com.qf.fmall2203.user.controller;


import com.qf.fmall2203.user.entity.UserAddr;
import com.qf.fmall2203.user.service.IUserAddrService;
import com.qf.fmall2203.utils.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/useraddr")
public class UserAddrController {

    @Autowired
    IUserAddrService userAddrService;

    @GetMapping("/list")
    public ResultVo userAddr(Integer userId){

        List<UserAddr> list =  userAddrService.userAddr(userId);

        return ResultVo.ok(list);

    }
}
